package com.example.demo.thread.finals.safecar;

/**
 * 线程安全的不可变坐标
 *
 * @author luowj12
 * @since 2021/6/30 15:21
 */
public final class Location2 {

    private final double x;

    private final double y;

    public Location2(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public double getX() {
        return x;
    }

    public double getY() {
        return y;
    }


    @Override
    public String toString() {
        return "Location{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }
}
